<template>
    <header class="home-header wrap" :class="{'header-color' : flag}">
    <i class="iconfont icon-caidan"></i>
    <div class="header-search">
        <span class="app-name">G</span>
        <i class="iconfont icon-search"></i>
        <span class="search-title">家电返场同价11.11</span>
    </div>
    <!-- <span>登录</span> -->
    <!-- <span class="iconfont icon-tuichudenglu"></span> -->
    <!-- <span ></span> -->
    <router-link tag="span" class="iconfont" v-if="!$store.state.islogin" to="login">&#xe60f;</router-link>
    <span class="iconfont" v-else>&#xe650;</span>
    
</header>
</template>
<script>



export default {
    data() {
        return {
            flag:false
        }
    },
    mounted(){
        let that = this
            window.addEventListener('scroll',function(){
             if(window.scrollY >= 200){
                 that.flag = true
                 
             }else{
                 that.flag = false
             }
            })
        }
    
}


</script>



<style lang="scss" scoped>
@import '../../../common/style/mixin.scss';
.header-color {
    background: $red;
}
.home-header {
    position: fixed;
    left: 0;
    top: 0;
    @include fj;
    width: 100%;
    height: 100px;
    line-height: 100px;
    padding: 0 30px;
    @include boxSizing;
    font-size: 30px;
    color: #fff;
    z-index: 10000;
    // background: $red;

    .icon-caidan,.iconfont {
        font-size: 50px;
    }

    .header-search {
        display: flex;
        width: 74%;
        height: 40px;
        line-height: 40px;
        margin: 20px 0;
        padding: 10px 0;
        color: #232326;
        background: #fff;
        @include borderRadius(40px);

        .app-name {
            padding: 0 20px;
            color: $red;
            font-size: 40px;
            font-weight: bold;
            border-right: 1px solid #666;
        }

        .icon-search {
            padding: 0 20px;
            font-size: 34px;
        }

        .search-title {
            font-size: 24px;
            color: #666;
        }
    }

    .icon-iconyonghu {
        font-size: 44px;
    }
}
</style>